package com.topisv.tms.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class InitProperties {

	private InitProperties() {

	}

	private static class InitSingle {
		private static Properties properties = null;
	}

	/**
	 * 读取IP地址
	 * 
	 * @return
	 * @throws IOException
	 */
	public static Properties initWeService() throws IOException {
		if (InitSingle.properties == null) {
			InputStream inputStream = InitProperties.class.getClassLoader().getResourceAsStream("wms.properties");
			try {
				InitSingle.properties = new Properties();
				InitSingle.properties.load(inputStream);
			} catch (IOException e) {
				throw e;
			}
		}
		return InitSingle.properties;

	}

	public static String get(String key) {
		Properties properties = null;
		try {
			properties = initWeService();
		} catch (IOException e) {
		}
		return properties.get(key).toString();
	}
}
